package com.express.e.root.bean;

import java.util.Date;
import java.util.Objects;

public class User {
    private Integer userId;
    private String userName;
    private String userPhone;
    private String userPwd;
    private String cardId;
    private Date userRegisterTime;
    private Date userLastLoginTime;


    public User(Integer userId, String userName, String userPhone, String userPwd, String cardId) {
        this.userId = userId;
        this.userName = userName;
        this.userPhone = userPhone;
        this.userPwd = userPwd;
        this.cardId = cardId;
    }

    public User(Integer userId, String userName, String userPhone, String userPwd, String cardId, Date userRegisterTime, Date userLastLoginTime, Integer isSaveWeekPwd) {
        this.userId = userId;
        this.userName = userName;
        this.userPhone = userPhone;
        this.userPwd = userPwd;
        this.cardId = cardId;
        this.userRegisterTime = userRegisterTime;
        this.userLastLoginTime = userLastLoginTime;
        this.isSaveWeekPwd = isSaveWeekPwd;
    }

    private Integer isSaveWeekPwd;

    @Override
    public String toString() {
        return "User{" +
                "userId=" + userId +
                ", userName='" + userName + '\'' +
                ", userPhone='" + userPhone + '\'' +
                ", userPwd='" + userPwd + '\'' +
                ", cardId='" + cardId + '\'' +
                ", userRegisterTime=" + userRegisterTime +
                ", userLastLoginTime=" + userLastLoginTime +
                ", isSaveWeekPwd=" + isSaveWeekPwd +
                '}';
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (!(o instanceof User)) return false;
        User user = (User) o;
        return Objects.equals(getUserId(), user.getUserId()) &&
                Objects.equals(getUserName(), user.getUserName()) &&
                Objects.equals(getUserPhone(), user.getUserPhone()) &&
                Objects.equals(getUserPwd(), user.getUserPwd()) &&
                Objects.equals(getCardId(), user.getCardId()) &&
                Objects.equals(getUserRegisterTime(), user.getUserRegisterTime()) &&
                Objects.equals(getUserLastLoginTime(), user.getUserLastLoginTime()) &&
                Objects.equals(getIsSaveWeekPwd(), user.getIsSaveWeekPwd());
    }

    @Override
    public int hashCode() {
        return Objects.hash(getUserId(), getUserName(), getUserPhone(), getUserPwd(), getCardId(), getUserRegisterTime(), getUserLastLoginTime(), getIsSaveWeekPwd());
    }

    public User(String userName, String userPhone, String userPwd, String cardId, Date userRegisterTime, Date userLastLoginTime) {
        this.userName = userName;
        this.userPhone = userPhone;
        this.userPwd = userPwd;
        this.cardId = cardId;
        this.userRegisterTime = userRegisterTime;
        this.userLastLoginTime = userLastLoginTime;
    }

    public String getCardId() {
        return cardId;
    }

    public void setCardId(String cardId) {
        this.cardId = cardId;
    }

    public User(String userName, String userPhone, String userPwd, Date userRegisterTime, Date userLastLoginTime) {
        this.userName = userName;
        this.userPhone = userPhone;
        this.userPwd = userPwd;
        this.userRegisterTime = userRegisterTime;
        this.userLastLoginTime = userLastLoginTime;
    }

    public User(Integer userId, String userName, String userPhone, String userPwd, Date userRegisterTime, Date userLastLoginTime, Integer isSaveWeekPwd) {
        this.userId = userId;
        this.userName = userName;
        this.userPhone = userPhone;
        this.userPwd = userPwd;
        this.userRegisterTime = userRegisterTime;
        this.userLastLoginTime = userLastLoginTime;
        this.isSaveWeekPwd = isSaveWeekPwd;
    }

    public Integer getUserId() {
        return userId;
    }

    public void setUserId(Integer userId) {
        this.userId = userId;
    }

    public String getUserName() {
        return userName;
    }

    public void setUserName(String userName) {
        this.userName = userName;
    }

    public String getUserPhone() {
        return userPhone;
    }

    public void setUserPhone(String userPhone) {
        this.userPhone = userPhone;
    }

    public String getUserPwd() {
        return userPwd;
    }

    public void setUserPwd(String userPwd) {
        this.userPwd = userPwd;
    }

    public Date getUserRegisterTime() {
        return userRegisterTime;
    }

    public void setUserRegisterTime(Date userRegisterTime) {
        this.userRegisterTime = userRegisterTime;
    }

    public Date getUserLastLoginTime() {
        return userLastLoginTime;
    }

    public void setUserLastLoginTime(Date userLastLoginTime) {
        this.userLastLoginTime = userLastLoginTime;
    }

    public Integer getIsSaveWeekPwd() {
        return isSaveWeekPwd;
    }

    public void setIsSaveWeekPwd(Integer isSaveWeekPwd) {
        this.isSaveWeekPwd = isSaveWeekPwd;
    }

    public User() {
    }
}
